<?php $public_application = $this->config->item('public_application');?>
<div class="main-bg clearfix">
  <div class="container main-box clearfix" style="max-width:970px;">
    <div class="row">
	 <?php
			if($ecardinfo){
	?>
      <div class="col-md-4 col-sm-4 hidden-xs"> 
        <div class="clearfix">
	        <img src="<?php echo base_url($ecardinfo['url']);?>" class="img-responsive pull-right" alt="<?php echo $ecardinfo['title'];?>" />
        </div>
      </div>
      <div class="col-md-6 col-sm-6 col-xs-10">
            <?php
				$attributes = array('class' => 'form-horizontal', 'role' => 'form','id'=>'form_confirm','name'=>'form_confirm');
				echo form_open_multipart(site_url('ecard/confirm'),$attributes);
		   ?>
              <h4 class="org-red">为品牌书命名</h4>
			  <div class="input-group" style="margin-bottom:20px;">
			    <span class="input-group-addon">
			      <span class="glyphicon glyphicon-book"></span>
			    </span>
			    <input type="text" name="title" class="form-control input-lg" value="<?php echo $ecardinfo['title'];?>" requeire  placeholder="名称">
				<input type='hidden'  name="act" value="update"/>
				<input type='hidden' name='id' value='<?php echo $ecardinfo['id']?>'>
		
			  </div>
			  <a id="btnsubmit"  class="btn btn-danger btn-lg">&nbsp;&nbsp;&nbsp;&nbsp;保存品牌书&nbsp;&nbsp;&nbsp;&nbsp;</a>
			<?php echo form_close();?> 
			
			<form action="<?php echo site_url('ecard/download/')?>" method="post" target="_blank">
			<input type="hidden" name="filename" value="<?php echo $ecardinfo['url']?>">
			<button type="submit" class="btn btn-danger btn-lg mt-3em">&nbsp;&nbsp;&nbsp;&nbsp;下载品牌书&nbsp;&nbsp;&nbsp;&nbsp;</button>
			</form>
	 </div>
	  
      <div class="col-md-2 col-sm-2 clearfix col-xs-2">

        <img src="<?php echo base_url($public_application."images/mkpr.jpg")?>" class="img-responsive pull-left mt-3em" />
      
	  </div>
	  <?php
			
			}else{
				echo "没有数据!";
			}
		  ?>
    </div>
  </div>
</div>
<div class="modal fade flex" id="modal_show">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">保存成功</h4>
      </div>
      <div class="modal-body">
        <p>快来分享给你的朋友吧</p>
            <!-- JiaThis Button BEGIN -->
			<div class="jiathis_style_32x32">
				<a class="jiathis_button_qzone"></a>
				<a class="jiathis_button_tsina"></a>
				<a class="jiathis_button_tqq"></a>
				<a class="jiathis_button_weixin"></a>
				<a class="jiathis_button_renren"></a>
				<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
			</div>
			<script>
			<?php if($ecardinfo){ ?>
			var jiathis_config = {
				pic:"<?php echo base_url($ecardinfo['url'])?>",
				data_track_clickback:true,
				"shortUrl":false
			}
			<?php } ?>
			</script>
			<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js?uid=1334755083138105" charset="utf-8"></script>
			<!-- JiaThis Button END -->
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

	<script src="<?php echo base_url($this->config->item('public'))?>/assets/js/jquery.form.js"></script>
	<script src="<?php echo base_url($this->config->item('public'))?>/assets/js/artDialog/jquery.artDialog.js?skin=zopo"></script>
	<script>
		$(function (){
		
				var form = $("#form_confirm");
		
				var options ={
					data:form.serialize(),
					dataType:'json',
					success:function (json){
						if(json.error != 1){
							/*art.dialog({
								id:'success',
								content:'保存成功！',
								lock:true
							});*/
							$('#modal_show').modal();
							//form.resetForm();
						}else{
						
							art.dialog({
								id:'error',
								content:'保存失败！',
								lock:true
							});
							
						}
					}
				};
		
		
				$('#btnsubmit').click(function (){
					form.ajaxForm();
				
					form.ajaxSubmit(options);
					return false;
				});

		});
	
	</script>